package frontend;

import java.awt.Color;
import java.awt.Dialog;
import java.awt.Font;
import java.awt.Frame;
import java.awt.GraphicsConfiguration;

import javax.swing.ImageIcon;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

import org.dyno.visual.swing.layouts.Constraints;
import org.dyno.visual.swing.layouts.GroupLayout;
import org.dyno.visual.swing.layouts.Leading;

//VS4E -- DO NOT REMOVE THIS LINE!
public class AuctionDialogV2 extends JDialog {

	private static final long serialVersionUID = 1L;
	private JLabel deed;
	private static final String PREFERRED_LOOK_AND_FEEL = "javax.swing.plaf.metal.MetalLookAndFeel";
	public AuctionDialogV2() {
		initComponents();
	}

	public AuctionDialogV2(Frame parent) {
		super(parent);
		initComponents();
	}

	public AuctionDialogV2(Frame parent, boolean modal) {
		super(parent, modal);
		initComponents();
	}

	public AuctionDialogV2(Frame parent, String title) {
		super(parent, title);
		initComponents();
	}

	public AuctionDialogV2(Frame parent, String title, boolean modal) {
		super(parent, title, modal);
		initComponents();
	}

	public AuctionDialogV2(Frame parent, String title, boolean modal,
			GraphicsConfiguration arg) {
		super(parent, title, modal, arg);
		initComponents();
	}

	public AuctionDialogV2(Dialog parent) {
		super(parent);
		initComponents();
	}


	private void initComponents() {
		setFont(new Font("Dialog", Font.PLAIN, 12));
		setBackground(Color.white);
		setForeground(Color.black);
		setLayout(new GroupLayout());
		add(getDeed(), new Constraints(new Leading(0, 12, 12), new Leading(0, 12, 12)));
		setSize(487, 410);
	}

	private JLabel getDeed() {
		if (deed == null) {
			deed = new JLabel();
			deed.setIcon(new ImageIcon(getClass().getResource("/images/deedsTitle/03_AngelIslington.jpg")));
		}
		return deed;
	}

	private static void installLnF() {
		try {
			String lnfClassname = PREFERRED_LOOK_AND_FEEL;
			if (lnfClassname == null)
				lnfClassname = UIManager.getCrossPlatformLookAndFeelClassName();
			UIManager.setLookAndFeel(lnfClassname);
		} catch (Exception e) {
			System.err.println("Cannot install " + PREFERRED_LOOK_AND_FEEL
					+ " on this platform:" + e.getMessage());
		}
	}

	/**
	 * Main entry of the class.
	 * Note: This class is only created so that you can easily preview the result at runtime.
	 * It is not expected to be managed by the designer.
	 * You can modify it as you like.
	 */
	public static void main(String[] args) {
		installLnF();
		SwingUtilities.invokeLater(new Runnable() {
			@Override
			public void run() {
				AuctionDialogV2 dialog = new AuctionDialogV2();
				dialog
						.setDefaultCloseOperation(AuctionDialogV2.DISPOSE_ON_CLOSE);
				dialog.setTitle("AuctionDialogV2");
				dialog.setLocationRelativeTo(null);
				dialog.getContentPane().setPreferredSize(dialog.getSize());
				dialog.pack();
				dialog.setVisible(true);
			}
		});
	}

}
